# ————————————————————  5.5.1字典介绍  ————————————————————
{}                                           # 创建空字典
{'A': '123', 'B': '135', 'C': '680'}  # 创建包含多个键值对的字典

dict_demo = {'A': '123', 'B': '135', 'C': '680'}
# result = dict_demo['C']     # 访问键对应的值
# print(result)

# dict_demo['A'] = '1*5@'   # 修改键对应的值
# print(dict_demo)

# dict_demo['D'] = '789'      # 增加键值对
# print(dict_demo)


# ————————————————————  5.5.2字典的常见操作  ————————————————————
dic = {'name': '小明', 'age': 23, 'height': 185}
result_one = dic.keys()      # 返回字典的键信息
print(result_one)
result_two = dic.values()    # 返回字典的值信息
print(result_two)
result_thr = dic.items()     # 返回字典的键值对信息
for key,value in result_thr:
    print(key, value)

print('name' in dic)
print('gender' in dic)
